<HTML>
<HEAD>
<TITLE></TITLE>

<link rel="stylesheet" type="text/css" href="css/fu.css"/>
<script type="text/javascript" src="../js/Util.js"></script>

</HEAD>

<BODY>

<script type="text/javascript">

var count = 100;

a = [];
for ( var i = 0 ; i < count ; i++ ) {
	var n = Math.floor( Math.random() * 100 );
	Util.insertIntoAscending( a, n );
	Util.log( 'result is ' + a );
	var last = a[ 0 ];
	for ( var j = 1 ; j < a.length ; j++, last = a[ j ] ) {
		 if ( a[ j ] > last ) {
			 Util.log( 'oh crap! ' + a[ j ] + ' and ' + last  );
		 }
	}
}

Util.log( '------------------------------' );

a = [];
for ( var i = 0 ; i < count ; i++ ) {
	var n = Math.floor( Math.random() * 100 );
	Util.insertIntoDescending( a, n );
	Util.log( 'result is ' + a );
	var last = a[ 0 ];
	for ( var j = 1 ; j < a.length ; j++, last = a[ j ] ) {
		 if ( a[ j ] < last ) {
			 Util.log( 'oh crap! ' + a[ j ] + ' and ' + last  );
		 }
	}
}

</script>


</BODY>
</HTML>
